<template>
  <div id="samplequery">
    <el-card class="box-card" style="margin:15px">
      <el-form
        ref="basicForm"
        :rules="basicDataRules"
        :inline="true"
        :model="basicData.model"
        class="demo-form-inline"
        size="small"
        label-width="150px"
      >
        <el-row>
          <el-col :span="6">
            <el-form-item label="所属区县:" width="300px" prop="areaId.key">
              <el-select
                size="mini"
                v-model="basicData.model.areaId.key"
                placeholder="选择"
                @change="clickOrgTree"
              >
                <el-option
                  v-for="(item, index) in orgTree"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                  width="300px"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属医院:" prop="hospitalId.key">
              <el-select
                size="mini"
                v-model="basicData.model.hospitalId.key"
                placeholder="选择"
                @change="clickOrgTreeC"
              >
                <el-option
                  v-for="(item, index) in orgTreeC"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属部门:" prop="departId.key">
              <el-select size="mini" v-model="basicData.model.departId.key" placeholder="选择">
                <el-option
                  v-for="(item, index) in orgTreeCs"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="6">
            <el-form-item label="母亲姓名:" prop="momName">
              <el-input size="mini" v-model="basicData.model.momName" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="婴儿性别:" prop="babySex.key">
              <el-radio-group v-model="basicData.model.babySex.key">
                <el-radio
                  v-for="(item, key, index) in dicts.BABY_SEX"
                  :key="item"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="母亲身份证:" prop="momCard">
              <el-input size="mini" v-model="basicData.model.momCard" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="手机号码:" prop="phone">
              <el-input size="mini" v-model="basicData.model.phone" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="支付方式:" prop="payWay.key">
              <el-select size="mini" v-model="basicData.model.payWay.key" placeholder="支付方式">
                <el-option
                  v-for="(item, key, index) in dicts.PAY_WAY"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="实验结论:" prop="experimentResult.key">
              <el-select
                size="mini"
                v-model="basicData.model.experimentResult.key"
                placeholder="全部"
              >
                <el-option
                  v-for="(item, key, index) in dicts.EXPERIMENT_RESULT"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="流程状态:" prop="flowStatus.key">
              <el-select size="mini" v-model="basicData.model.flowStatus.key" placeholder="请选择">
                <el-option
                  v-for="(item, key, index) in dicts.FLOW_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="样本质量:" prop="sampleQuality.key">
              <el-select size="mini" v-model="basicData.model.sampleQuality.key" placeholder="请选择">
                <el-option
                  v-for="(item, key, index) in dicts.SAMPLE_QUALITY"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="来源方式:" prop="sourceWay.key">
              <el-select size="mini" v-model="basicData.model.sourceWay.key" placeholder="请选择">
                <el-option
                  v-for="(item, key, index) in dicts.SOURCE_WAY"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="样本属性:" prop="bloodProperty.key">
              <el-select size="mini" v-model="basicData.model.bloodProperty.key" placeholder="请选择">
                <el-option
                  v-for="(item, key, index) in dicts.BLOOD_PROPERTY"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6" style="padding-left: 25px;">
            <el-form-item label="项目查询类型:" prop="projectQueryType.key">
              <el-radio-group v-model="basicData.model.projectQueryType.key">
                <el-radio
                  :label="key"
                  v-for="(item, key, index) in dicts.PROJECT_QUERY_TYPE"
                  :key="index"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-col :span="12" style="display:flex;padding-left: 2.5vw;" class="time-list">
              <el-form-item style="width:100%">
                <el-select
                  size="mini"
                  style="width:120px !important"
                  v-model="timeType"
                  placeholder="出生日期"
                >
                  <el-option
                    v-for="(item, key, index) in dicts.TIME"
                    :key="index"
                    :label="item"
                    :value="key"
                  />
                </el-select>
                <el-date-picker
                  size="mini"
                  v-model="timeList"
                  type="daterange"
                  value-format="yyyy-MM-dd"
                  style="width:100%"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12" style="display:flex;padding-left: 2.5vw;">
              <el-form-item>
                <el-select
                  style="width:96px !important"
                  size="mini"
                  v-model="codeType"
                  placeholder="条形码号"
                >
                  <el-option
                    v-for="(item, key, index) in dicts.NUMBER"
                    :key="index"
                    :label="item"
                    :value="key"
                  />
                </el-select>
              </el-form-item>
              <div style="display:flex;align-items: center;width:100%">
                <el-form-item style="width:100%">
                  <el-input
                    size="mini"
                    v-model="codeList.start"
                    placeholder="输入"
                    style="width:100%"
                  />
                </el-form-item>
                <span style="margin: 0 17px">至</span>
                <el-form-item style="width:100%">
                  <el-input size="mini" v-model="codeList.end" placeholder="输入" style="width:100%" />
                </el-form-item>
              </div>
            </el-col>
          </el-col>
          <el-col id="shiyan" :span="24" class="more-col">
            <el-form-item label="实验项目:" class="pj" prop="experimentProject">
              <el-checkbox-group v-model="basicData.model.experimentProject">
                <el-checkbox
                  v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                  :label="key"
                  name="type"
                >{{ item }}</el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div class="buttom" style="margin-top: 7px;">
        <el-button
          type="primary"
          size="small"
          style="width:100px"
          icon="el-icon-search"
          @click="onSubmit('query')"
        >查询</el-button>
        <el-button size="small" @click="onSubmit('reset')">重置</el-button>
      </div>
    </el-card>
    <el-card class="box-card" style="margin:5px 15px;">
      <div style="margin-bottom:10px">
        <el-button size="small" type="primary" icon="el-icon-edit" @click="clickEdit">修改</el-button>
        <!-- <el-button size="small" type="primary" icon="el-icon-edit">
          超级修改
        </el-button>-->
        <el-button size="small" type="primary" icon="el-icon-tickets" @click="clickEditPj">项目</el-button>
        <el-button
          size="small"
          type="primary"
          icon="el-icon-document-checked"
          @click="clickEditJl"
        >结论</el-button>
        <!-- <el-button size="small" type="primary" icon="el-icon-document-delete">
          重审
        </el-button>-->
        <!-- <el-button size="small" type="primary">
          强制审核
        </el-button>-->
        <el-button size="small" type="primary" icon="el-icon-s-unfold" @click="clickDown">导出</el-button>
        <!-- <el-button size="small" type="primary" icon="el-icon-s-unfold" @click="clickImport">
          导入
        </el-button>-->
        <el-button size="small" @click="clickDelete">删除</el-button>
        <!-- <el-button size="small">
          跨部门删除
        </el-button>-->
      </div>
      <!-- <div class="searchWord">
        <div style="display: inline-block">
          搜索：
        </div>
        <el-input
          size="mini"
          v-model="search"
          style="display: inline-block;width: 1300px"
          placeholder="请输入搜索内容"
        />
      </div>-->
      <el-table
        v-loading="loading"
        :data="tables"
        style="width: 100%;padding:5px;"
        :header-cell-style="{
          background: '#333333',
          color: '#ffffff',
          textAlign: 'center'
        }"
        :row-key="getRowKeys"
        @selection-change="onSelectChange"
        @expand-change="expandChange"
        :expand-row-keys="expandId"
      >
        <!-- <el-table-column type="expand">
          <template slot-scope="props">
            <el-table
              :data="expandList"
              :header-cell-style="{
                background: '#333333',
                color: '#ffffff',
                textAlign: 'center'
              }"
              border
              v-loading="expandeShow"
              style="max-width:1000px"
            >
              <el-table-column align="center" type="index" width="35" />
              <el-table-column align="center" label="项目" width="150px">
                <template slot-scope="scope">
                  <span>
                    {{
                    scope.row.projectTypeName
                    ? scope.row.projectTypeName
                    : "暂无"
                    }}
                  </span>
                </template>
              </el-table-column>
              <el-table-column align="center" prop="updateTime" label="实验日期" width="150px">
                <template slot-scope="scope">
                  <span>{{ scope.row.updateTime ? scope.row.updateTime.substr(0, 10) : "暂无" }}</span>
                </template>
              </el-table-column>
              <el-table-column align="center" prop="experimentValue" label="值" width="150px">
                <template slot-scope="scope">
                  <span>
                    {{
                    scope.row.experimentValue
                    ? scope.row.experimentValue
                    : "暂无"
                    }}
                  </span>
                </template>
              </el-table-column>
              <el-table-column align="center" prop="experimentResult.data" label="结论" width="150px">
                <template slot-scope="scope">
                  <span>
                    {{
                    scope.row.experimentResult.data
                    ? scope.row.experimentResult.data
                    : "暂无"
                    }}
                  </span>
                </template>
              </el-table-column>
              <el-table-column align="center" prop="doctorAdvice" label="医嘱" show-overflow-tooltip>
                <template slot-scope="scope">
                  <span>
                    {{
                    scope.row.doctorAdvice ? scope.row.doctorAdvice : "暂无"
                    }}
                  </span>
                </template>
              </el-table-column>
            </el-table>
          </template>
        </el-table-column>-->
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column align="center" type="index" width="35" />
        <el-table-column align="center" prop="expNum" label="实验编号" width="150px" />
        <el-table-column align="center" prop="sumExperimentResult" label="实验结论" />
        <el-table-column align="center" prop="experimentKeywords.data" label="实验项目">
          <!-- <template slot-scope="scope">
            <span
              v-if="scope.row.sumExperimentResult=='正常'"
              style="color: #1890ff;cursor: pointer;"
              @click="clickSeeExpValue(scope.row)"
            >{{ scope.row.experimentKeywords.data }}</span>
            <span v-else>{{ scope.row.experimentKeywords.data}}</span>
          </template>-->
          <template slot-scope="scope">
            <span
              v-html="scope.row.experimentKeywords.data"
              @click="scope.row.sumExperimentCode?clickSeeExpValue(scope.row):''"
            ></span>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="momName" label="母亲姓名" />
        <el-table-column align="center" prop="birthTime" label="出生日期" width="100px">
          <template slot-scope="scope">
            <span>{{ scope.row.birthTime?scope.row.birthTime.substr(0, 10):'' }}</span>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="bloodTime" label="采血日期" width="100px">
          <template slot-scope="scope">
            <span>{{ scope.row.bloodTime?scope.row.bloodTime.substr(0, 10):'' }}</span>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="babySex.data" label="性别" />
        <el-table-column align="center" prop="flowStatus.data" label="流程状态" />
        <el-table-column align="center" prop="barCode" label="条形号码" width="150px" />
        <el-table-column align="center" prop="phone" label="手机号码" width="150px" />
        <el-table-column
          align="center"
          width="300px"
          prop="hospitalId.data.label"
          label="所属医院"
          show-overflow-tooltip
        />
        <el-table-column
          width="300px"
          align="center"
          prop="departId.data.label"
          label="当前部门"
          show-overflow-tooltip
        />
        <el-table-column align="center" prop="bloodProperty.data" label="样本属性" />
        <el-table-column align="center" prop="sourceWay.data" label="来源方式" />
        <el-table-column align="center" prop="payWay.data" label="支付方式" />
        <el-table-column align="center" prop="costType.data" label="费用类型" />
        <el-table-column
          align="center"
          prop="sampleQuality.data"
          label="样本质量"
          width="150px"
          show-overflow-tooltip
        />
        <!-- <el-table-column prop="projectIdList" label="发送状态" /> -->
        <el-table-column
          align="center"
          prop="remark"
          label="筛查备注"
          width="300px"
          show-overflow-tooltip
        />
        <!-- <el-table-column prop="projectIdList" label="推送报告" /> -->
      </el-table>
      <el-pagination
        :current-page="basicData.current"
        :page-size="basicData.size"
        :total="total"
        layout="slot,total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      >
        <span
          v-if="selectList.length > 0"
          style="font-weight: 400;color:#606266"
        >已选中{{ selectList.length }}条，</span>
      </el-pagination>
    </el-card>

    <!-- 修改 -->
    <el-dialog :visible.sync="editShow" width="80%" center custom-class="print-dialog">
      <span
        slot="title"
        class="dialog-title"
        style="font-size: 18px;font-weight: 400;color: #FFFFFF;"
      >修改</span>
      <el-form
        v-if="selectItem.areaId"
        ref="editForm"
        :rules="editDataRules"
        :inline="true"
        :model="selectItem"
        class="demo-form-inline"
        size="small"
        label-width="120px"
      >
        <el-row>
          <el-col :span="6">
            <el-form-item label="所属区县:" width="300px">
              <el-select
                size="mini"
                v-model="selectItem.areaId.key"
                placeholder="选择"
                @change="clickOrgTree"
              >
                <el-option
                  v-for="(item, index) in orgTree"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                  width="300px"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属医院:">
              <el-select
                size="mini"
                v-model="selectItem.hospitalId.key"
                placeholder="选择"
                @change="clickOrgTreeC"
              >
                <el-option
                  v-for="(item, index) in orgTreeC"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属部门:">
              <el-select size="mini" v-model="selectItem.departId.key" placeholder="选择">
                <el-option
                  v-for="(item, index) in orgTreeCs"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="6">
            <el-form-item label="采血编号:" prop="bloodnum">
              <el-input size="mini" v-model="selectItem.bloodnum" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="条形码号:" prop="codeType">
              <el-input size="mini" v-model="selectItem.codeType" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="母亲姓名:" prop="momName">
              <el-input size="mini" v-model="selectItem.momName" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="婴儿性别:" prop="babySex.key">
              <el-radio-group v-model="selectItem.babySex.key">
                <el-radio
                  v-for="(item, key, index) in dicts.BABY_SEX"
                  :key="item"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="出生日期:" prop="birthtime">
              <el-date-picker
                size="mini"
                :format="birthTimeFormat"
                @focus="selectItem.birthTime = ''"
                v-model="selectItem.birthTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="采血日期:" prop="bloodtime">
              <el-date-picker
                size="mini"
                :format="bloodTimeFormat"
                @focus="selectItem.bloodTime = ''"
                v-model="selectItem.bloodTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="手机号码:" prop="phone">
              <el-input size="mini" v-model="selectItem.phone" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="婴儿体重:" prop="weight">
              <el-input size="mini" v-model="selectItem.weight" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="孕周:" prop="weeks">
              <el-input size="mini" v-model="selectItem.weeks" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="孕天:" prop="days">
              <el-input size="mini" v-model="selectItem.days" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="母亲身份证:" prop="momCard">
              <el-input size="mini" v-model="selectItem.momCard" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="住址:" prop="address">
              <el-input size="mini" v-model="selectItem.address" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="母亲户籍:" prop="momCensus.data">
              <el-input size="mini" disabled v-model="selectItem.momCensus.data" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="样本质量:" prop="sampleQuality.key">
              <el-select
                size="mini"
                disabled
                v-model="selectItem.sampleQuality.key"
                placeholder="请选择"
              >
                <el-option
                  v-for="(item, key, index) in dicts.SAMPLE_QUALITY"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="采血人:" prop="samplingPeople">
              <el-input size="mini" v-model="selectItem.samplingPeople" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="筛查备注:" prop="remark">
              <el-input size="mini" v-model="selectItem.remark" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-row id="more-row">
              <el-col id="shiyan" :span="16" class="more-col">
                <el-form-item label="实验项目:" class="projectIdList" prop="experimentProject">
                  <el-checkbox-group disabled v-model="selectItem.experimentProject">
                    <el-checkbox
                      v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                      :label="key"
                      name="type"
                    >{{ item }}</el-checkbox>
                  </el-checkbox-group>
                </el-form-item>
              </el-col>
            </el-row>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="送检医生:" prop="getexamineDoctor">
              <el-input size="mini" v-model="selectItem.getexamineDoctor" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="实验编号:" prop="expNum">
              <el-input size="mini" disabled v-model="selectItem.expNum" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="费用类型:" prop="costType.key">
              <el-radio-group v-model="selectItem.costType.key">
                <el-radio
                  v-for="(item, key, index) in dicts.COST_TYPE"
                  :key="item"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="父亲身份证:" prop="dadCard">
              <el-input size="mini" v-model="selectItem.dadCard" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="免费券号:" prop="freeNum">
              <el-input size="mini" v-model="selectItem.freeNum" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          style="padding: 6px 19px;"
          @click="onSubmit('edit')"
        >保存</el-button>
      </span>
    </el-dialog>

    <!-- 项目修改 -->
    <el-dialog :visible.sync="pjShow" width="80%" center custom-class="print-dialog">
      <span
        slot="title"
        class="dialog-title"
        style="font-size: 18px;font-weight: 400;color: #FFFFFF;"
      >项目修改</span>
      <div class="edit-dialog">
        <el-row>
          <div class="mores" style="margin-bottom:20px">
            <div class="more-title">基础信息</div>
          </div>
          <el-col :span="6">
            <span style="margin-left:30px">所属医院：</span>
            <!-- <span>{{ selectItem.hospitalId.data ? selectItem.hospitalId.data.label:'' }}</span> -->
            <span>{{ selectItem.hosipitalId && selectItem.hosipitalId.data === null ? '11' : "" }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin-left:30px">母亲姓名:</span>
            <span>{{ selectItem.momName?selectItem.momName:'' }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin-left:30px">出生日期:</span>
            <span>{{ selectItem.birthtime?selectItem.birthtime:'' }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin-left:30px">性 别:</span>
            <span>{{ selectItem.babySex?selectItem.babySex.data:'' }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin-left:30px">手机号码:</span>
            <span>{{ selectItem.phone?selectItem.phone:'' }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin-left:30px">条形码号:</span>
            <span>{{ selectItem.barcode?selectItem.barcode:'' }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin-left:30px">实验编号：</span>
            <span>{{ selectItem.expnum?selectItem.expnum:'' }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin-left:30px">联系地址:</span>
            <span>{{ selectItem.address?selectItem.address:'' }}</span>
          </el-col>
          <el-col :span="24">
            <div class="mores" style="margin-top:20px">
              <div class="more-title">实验项目</div>
            </div>
            <el-form>
              <el-row id="more-row">
                <el-col id="shiyan" :span="16" class="more-col" style="padding-left:30px">
                  <el-form-item label="实验项目:" class="projectIdList" prop="experimentProject">
                    <el-checkbox-group
                      v-model="selectItem.experimentProject"
                      @change="clickCheckBox"
                    >
                      <el-checkbox
                        v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                        :label="key"
                        name="type"
                      >{{ item }}</el-checkbox>
                    </el-checkbox-group>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </el-col>
        </el-row>
      </div>

      <span slot="footer" class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          style="padding: 6px 19px;"
          @click="onSubmit('pjEdit')"
        >保存</el-button>
      </span>
    </el-dialog>

    <!-- 结论 -->
    <el-dialog :visible.sync="jlShow" width="80%" center custom-class="print-dialog">
      <span
        slot="title"
        class="dialog-title"
        style="font-size: 18px;font-weight: 400;color: #FFFFFF;"
      >结论修改</span>
      <div class="edit-dialog" v-if="selectItem.momName">
        <div class="mores" style="margin-bottom:20px">
          <div class="more-title">基础信息</div>
        </div>
        <el-row>
          <el-col :span="6">
            <span style="margin:30px">所属医院：</span>
            <span>{{ selectItem.hospitalId.data ? selectItem.hospitalId.data.label ? selectItem.hospitalId.data.label :'' :'' }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin:30px">母亲姓名:</span>
            <span>{{ selectItem.momName }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin:30px">出生日期:</span>
            <span>{{ selectItem.birthtime }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin:30px">性 别:</span>
            <span>{{ selectItem.babySex.data }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin:30px">手机号码:</span>
            <span>{{ selectItem.phone }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin:30px">条形码号:</span>
            <span>{{ selectItem.barcode }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin:30px">实验编号：</span>
            <span>{{ selectItem.expnum }}</span>
          </el-col>
          <el-col :span="6">
            <span style="margin:30px">联系地址:</span>
            <span>{{ selectItem.address }}</span>
          </el-col>
          <el-col :span="24">
            <div class="mores" style="margin-top:20px">
              <div class="more-title">实验项目</div>
            </div>
            <el-table
              :data="jlList"
              style="width: 100%;padding:5px;"
              :header-cell-style="{
                background: '#333333',
                color: '#ffffff',
                textAlign: 'center'
              }"
            >
              <el-table-column align="center" type="index" width="35" />
              <el-table-column align="center" prop="projectTypeName" label="项目" />
              <el-table-column align="center" prop="updateTime" label="实验日期" />
              <el-table-column align="center" prop="experimentValue" label="值" />
              <el-table-column align="center" prop="experimentResult.data" label="结论">
                <template slot-scope="scope">
                  <el-select
                    size="mini"
                    disabled
                    v-model="scope.row.experimentResult.key"
                    placeholder="全部"
                  >
                    <el-option
                      v-for="(item, key, index) in dicts.EXPERIMENT_RESULT"
                      :key="index"
                      :label="item"
                      :value="key"
                    />
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column align="center" prop="doctorAdvice" label="医嘱" />
            </el-table>
          </el-col>
        </el-row>
      </div>

      <span slot="footer" class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          style="padding: 6px 19px;"
          @click="onSubmit('jlEdit')"
        >保存</el-button>
      </span>
    </el-dialog>

    <!-- 点击查看 -->
    <el-dialog width="65%" title="实验数据" :visible.sync="seeShow" append-to-body>
      <!-- 表格 -->
      <el-row style="line-height: 1.5;border:1px solid">
        <el-col
          :span="5"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
        >筛查项目</el-col>
        <el-col
          :span="3"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
        >检测指标</el-col>
        <el-col
          :span="3"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
        >检测值</el-col>
        <el-col
          :span="5"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
        >正常参考值</el-col>
        <el-col
          :span="8"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;"
        >筛查结果</el-col>
        <!-- hint -->
      </el-row>
      <!-- 表格内容 -->
      <el-row
        style="line-height: 1.5;border-bottom:1px solid;border-left:1px solid;border-right:1px solid;"
      >
        <div v-for="(item, key, index) in seeData" :key="index">
          <el-col
            :span="5"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.indicatorCodeName }}&nbsp</el-col>
          <el-col
            :span="3"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.indicatorCode }}&nbsp</el-col>
          <el-col
            :span="3"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.experimentValue }}{{ item.units }}&nbsp</el-col>
          <el-col
            :span="5"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.referenceValue }}&nbsp</el-col>
          <el-col
            :span="8"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.hint }}&nbsp</el-col>
        </div>
      </el-row>
    </el-dialog>

    <el-dialog :visible.sync="dialogShow" width="85%" center custom-class="print-dialog">
      <span
        slot="title"
        class="dialog-title"
        style="font-size: 18px;font-weight: 400;color:#fff"
      >报告打印</span>
      <!-- 传统 -->
      <chuantong :dataList="printData" v-if="printType == 'PHE+TSH+17_a_OHP+G6PD'"></chuantong>
      <!-- 串联 -->
      <chuanlian :dataList="printData" v-if="printType == 'MSMS'"></chuanlian>
      <!-- 地贫 -->
      <diping :dataList="printData" v-if="printType == 'THA'"></diping>
      <!-- 耳聋基因 -->
      <span slot="footer" class="dialog-footer">
        <el-button v-print="'#print'" size="small" type="primary" style="padding: 6px 19px;">打 印</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { initDicts } from "@/utils/commons";
import orgApi from "@/api/Org.js";
import QueryManageApi from "@/api/QueryManage.js";
import diping from "./diping.vue";

export default {
  components: {
    diping
  },
  data() {
    return {
      // 出生日期输入格式
      birthTimeFormat: "MMdd",
      // 采血日期输入格式
      bloodTimeFormat: "MMdd",
      // 是否展示更多信息
      morderShow: true,
      printData: [],
      // 转菊花
      loading: false,
      // 修改
      editShow: false,
      // 项目修改
      pjShow: false,
      // 结论修改
      jlShow: false,
      // 展开行转菊花
      expandeShow: false,
      // 打印弹窗
      dialogShow: false,
      // 打印报告类型
      printType: "THA",
      // 结论修改列表
      jlList: [],
      // 文件
      file: {},
      // 页条数
      pageSize: 10,
      // 页数
      pageIndex: 1,
      // 表格数据
      tableData: [],
      // 基本数据
      basicData: {
        current: 1,
        map: {},
        model: {
          areaId: {
            key: ""
          },
          babySex: {
            data: "",
            key: ""
          },
          barCode: {
            end: "",
            start: ""
          },
          birthTime: {
            end: "",
            start: ""
          },
          bloodNum: {
            end: "",
            start: ""
          },
          bloodProperty: {
            data: "",
            key: ""
          },
          bloodReview: {
            data: "",
            key: ""
          },
          bloodStatus: {
            data: "",
            key: ""
          },
          bloodTime: {
            end: "",
            start: ""
          },
          costType: {
            data: "",
            key: ""
          },
          createTime: {
            end: "",
            start: ""
          },
          days: 0,
          departId: {
            key: ""
          },
          expNum: {
            end: "",
            start: ""
          },
          experimentKeywords: "",
          experimentProject: [],
          experimentResult: {
            data: "",
            key: ""
          },
          experimentTime: {
            end: "",
            start: ""
          },
          fileStatus: {
            data: "",
            key: ""
          },
          flowStatus: {
            data: "",
            key: ""
          },
          freeNum: {
            end: "",
            start: ""
          },
          hospitalId: {
            key: ""
          },
          momCard: "",
          momName: "",
          payWay: {
            data: "",
            key: ""
          },
          phone: "",
          projectQueryType: {
            data: "",
            key: ""
          },
          reportTime: {
            end: "",
            start: ""
          },
          sampleQuality: {
            data: "",
            key: ""
          },
          sourceWay: {
            data: "",
            key: ""
          },
          weeks: 0,
          weight: 0
        },
        order: "descending",
        size: 10,
        sort: "id"
      },
      rowData: {},
      selectItem: {},
      search: "",
      // 校验
      basicDataRules: {
        "areaId.key": [{ required: false, message: "", trigger: "change" }],
        "hospitalId.key": [{ required: false, message: "", trigger: "change" }],
        "departId.key": [{ required: false, message: "", trigger: "change" }],
        momName: [{ required: false, message: "", trigger: "change" }],
        "babySex.key": [{ required: false, message: "", trigger: "change" }],
        momCard: [{ required: false, message: "", trigger: "change" }],
        phone: [{ required: false, message: "", trigger: "change" }],
        "payWay.key": [{ required: false, message: "", trigger: "change" }],
        "experimentResult.key": [
          { required: false, message: "", trigger: "change" }
        ],
        "flowStatus.key": [{ required: false, message: "", trigger: "change" }],
        "sampleQuality.key": [
          { required: false, message: "", trigger: "change" }
        ],
        "sourceWay.key": [{ required: false, message: "", trigger: "change" }],
        "bloodProperty.key": [
          { required: false, message: "", trigger: "change" }
        ],
        "projectQueryType.key": [
          { required: false, message: "", trigger: "change" }
        ],
        timeType: [{ required: false, message: "", trigger: "change" }],
        timeList: [{ required: false, message: "", trigger: "change" }],
        codeType: [{ required: false, message: "", trigger: "change" }],
        "codeList.start": [{ required: false, message: "", trigger: "change" }],
        "codeList.end": [{ required: false, message: "", trigger: "change" }],
        experimentProject: [{ required: false, message: "", trigger: "change" }]
      },
      // 校验
      editDataRules: {
        "areaId.key": [{ required: true, message: "必填", trigger: "change" }],
        "hospitalId.key": [
          { required: true, message: "必填", trigger: "change" }
        ],
        "departId.key": [
          { required: true, message: "必填", trigger: "change" }
        ],
        momName: [{ required: true, message: "必填", trigger: "change" }],
        phone: [
          { required: true, message: "必填", trigger: "change" },
          {
            required: true,
            pattern: /^1[3456789]\d{9}$/,
            message: "请输入正确格式的手机号",
            trigger: "blur"
          }
        ],
        weight: [
          { required: true, message: "必填", trigger: "change" },
          {
            pattern: /^[0-9]*$/,
            message: "请填写正确格式的数字",
            trigger: "change"
          },
          {
            required: true,
            validator: this.$weightNum,
            trigger: "blur",
            message: "请输入600—8000的数字"
          }
        ],
        weeks: [
          { required: true, message: "必填", trigger: "change" },
          {
            pattern: /^[0-9]*$/,
            message: "请填写正确格式的数字",
            trigger: "change"
          },
          {
            required: true,
            validator: this.$weeksNum,
            trigger: "blur",
            message: "请输入20—50的数字"
          }
        ],
        // days: [
        //   { required: true, message: "必填", trigger: "change" },
        //   {
        //     pattern: /^[0-9]*$/,
        //     message: "请填写正确格式的数字",
        //     trigger: "change"
        //   },
        //   {
        //     required: true,
        //     validator: this.$daysNum,
        //     trigger: "blur",
        //     message: "请输入0—6的数字"
        //   }
        // ],
        birthTime: [{ required: true, message: "  ", trigger: "change" }],
        bloodTime: [{ required: true, message: "  ", trigger: "change" }],
        babySex: [{ required: true, message: "  ", trigger: "change" }],
        barCode: [
          {
            required: true,
            message: "必填",
            trigger: "change"
          },
          {
            pattern: /^[0-9]*$/,
            message: "请填写正确格式的数字",
            trigger: "change"
          },
          {
            required: true,
            validator: this.$barCodeNum,
            trigger: "blur",
            message: "请输入14000000000—20999999999的数字"
          }
        ],
        costType: [{ required: true, message: "  ", trigger: "change" }],
        dadCard: [
          {
            pattern: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/,
            message: "身份证号格式错误",
            trigger: "change"
          }
        ],
        momCard: [
          {
            pattern: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/,
            message: "身份证号格式错误",
            trigger: "change"
          }
        ],
        freeNum: [
          {
            pattern: /^[0-9]*$/,
            message: "请填写正确格式的数字",
            trigger: "change"
          },
          {
            validator: this.$freeNum,
            message: "请输入200110001—200145000的数字",
            trigger: "change"
          }
        ]
      },
      // 字典
      dicts: {
        BLOOD_STATUS: {}, //采样状态
        PAY_WAY: {}, //交付方式
        EXPERIMENT_RESULT: {}, //实验结论
        FLOW_STATUS: {}, //流程状态
        SAMPLE_QUALITY: {}, //样本质量
        SOURCE_WAY: {}, //来源方式
        BABY_SEX: {}, //性别
        BLOOD_PROPERTY: {}, //样本属性
        PROJECT_QUERY_TYPE: {}, //项目查询类型
        TIME: {}, //时间
        NUMBER: {}, //编码
        COST_TYPE: {}, //费用类型
        EXPERIMENT_CODE: {} //项目
      },
      // 市县
      orgTree: [],
      // 医院
      orgTreeC: [],
      // 部门
      orgTreeCs: [],
      //时间类型
      timeType: "",
      //编码类型
      codeType: "",
      //时间列表
      timeList: [],
      // 选择数据
      selectList: [],
      total: 0,
      // 编码
      codeList: {
        start: "",
        end: ""
      },
      // 展开行数据
      expandList: [],
      // 展开行id
      expandId: [],
      getRowKeys(row) {
        return row.id;
      },
      seeShow: false,
      seeData: {}
    };
  },
  computed: {
    // 模糊搜索
    tables() {
      const search = this.search;
      if (search) {
        this.tableData.filter(data => {
          Object.keys(data).some(key => {
            if (
              String(data[key])
                .toLowerCase()
                .indexOf(search) > -1
            ) {
              this.tableData.splice(this.tableData.indexOf(data), 1);
              this.tableData.unshift(data);
            }
            // return this.tableData;
          });
        });
      }
      return this.tableData;
    }
  },
  mounted() {
    initDicts(
      [
        "BLOOD_STATUS",
        "PAY_WAY",
        "EXPERIMENT_RESULT",
        "FLOW_STATUS",
        "SOURCE_WAY",
        "SAMPLE_QUALITY",
        "BABY_SEX",
        "BLOOD_PROPERTY",
        "PROJECT_QUERY_TYPE",
        "TIME",
        "NUMBER",
        "COST_TYPE",
        "EXPERIMENT_CODE"
      ],
      this.dicts
    );
    // 获取基础查询
    this.initOrgTree();
    // 获取表格数据
    this.getList(this.basicData);
  },
  methods: {
    // 出生日期输入
    changeBirthTime(v, type) {
      this.selectItem.birthTime = v;
      if (this.selectItem.birthTime) {
        this.birthTimeFormat = "yyyy-MM-dd";
      } else {
        this.birthTimeFormat = "MMdd";
      }
    },
    // 采血日期输入
    changeBloodTime(v, type) {
      this.selectItem.bloodTime = v;
      if (this.selectItem.bloodTime) {
        this.bloodTimeFormat = "yyyy-MM-dd";
      } else {
        this.bloodTimeFormat = "MMdd";
      }
    },
    // 点击查看
    clickSeeExpValue(v) {
      QueryManageApi.reportQuery
        .viewReport({
          code: v.experimentKeywords.key,
          sampleId: v.id
        })
        .then(res => {
          if (res.status == 200) {
            if (res.data.data) {
              this.dialogShow = true;
              let sortData = [];

              for (let key in res.data.data.experimentValue) {
                sortData.push(res.data.data.experimentValue[key]);
              }
              res.data.data.experimentValue = this.$keysrt(
                sortData,
                "sortValue"
              );
              this.printData = [res.data.data];
            }
          } else {
            this.$message.error(res.statusText);
          }
        });
    },
    // 点击导出
    clickDown() {
      QueryManageApi.sampleQuerys.export(this.basicData).then(res => {
        console.log(res.data);
      });
    },
    // // 点击查看更多
    // clickSeeExpValue(v) {
    //   this.seeShow = true;
    //   QueryManageApi.sampleQuerys
    //     .getNotBankExperimentsById({ id: v.id })
    //     .then(res => {
    //       this.seeData = res.data.data[0].experimentValue;
    //     });
    // },
    // 点击修改
    clickEdit() {
      if (this.selectList.length > 1) {
        this.$message.error("只能选择一条数据");
      } else if (this.selectList.length == 0) {
        this.$message.error("请选择数据");
      } else {
        this.selectItem = JSON.parse(JSON.stringify(this.selectList[0]));
        this.selectList.forEach((item, index) => {
          this.orgTree.filter(res => {
            if (res.id == item.areaId.key) {
              this.orgTreeC = res.children;
            }
          });
          this.orgTreeC.filter(res => {
            if (res.id == item.hospitalId.key) {
              this.orgTreeCs = res.children;
            }
          });
        });
        if (this.selectItem.experimentProject == null) {
          this.selectItem.experimentProject = [];
        }
        this.editShow = true;
      }
    },
    // 修改项目选择
    clickCheckBox(v) {
      this.selectItem.experimentProject = v;
    },
    // 点击项目修改
    clickEditPj() {
      if (this.selectList.length > 1) {
        this.$message.error("只能选择一条数据");
      } else if (this.selectList.length == 0) {
        this.$message.error("请选择数据");
      } else {
        this.selectItem = JSON.parse(JSON.stringify(this.selectList[0]));
        this.pjShow = true;
        if (this.selectItem.experimentProject == null) {
          this.selectItem.experimentProject = [];
        }
      }
    },
    // 结论修改
    clickEditJl() {
      if (this.selectList.length > 1) {
        this.$message.error("只能选择一条数据");
      } else if (this.selectList.length == 0) {
        this.$message.error("请选择数据");
      } else {
        this.selectItem = JSON.parse(JSON.stringify(this.selectList[0]));
        QueryManageApi.sampleQuerys
          .getExperimentsById({ id: this.selectItem.id })
          .then(res => {
            this.jlList = res.data.data;
          });
        if (this.selectItem.experimentProject == null) {
          this.selectItem.experimentProject = [];
        }
        this.jlShow = true;
      }
    },
    //删除
    clickDelete() {
      if (this.selectList.length == 0) {
        this.$message.error("请选择数据");
      } else {
        this.$confirm(`谨慎操作`, `是否删除${this.selectList.length}条数据？`, {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          this.selectList.forEach((item, index) => {
            QueryManageApi.sampleQuerys
              .delete({ "ids[]": item.id })
              .then(res => {
                if (res.status == 200) {
                  this.getList(this.basicData);
                  this.$message({
                    type: "success",
                    message: "删除成功!"
                  });
                } else {
                  this.$message.error("删除失败!");
                }
              });
          });
        });
      }
    },
    // 获取table
    getList(data) {
      this.loading = true;
      QueryManageApi.sampleQuerys.page(data).then(res => {
        this.tableData = res.data.data.records;
        this.tableData.forEach((item, index) => {
          if (item.sumExperimentCode) {
            let keyList = [];
            let keyTitle = [];

            keyList = item.experimentKeywords.key.split("+");
            keyTitle = item.experimentKeywords.data.split("+");

            item.sumExperimentCode.split("+").forEach(i => {
              if (keyList.indexOf(i) > -1) {
                keyTitle[
                  keyList.indexOf(i)
                ] = `<span v-if="scope.row.sumExperimentCode" style="color: #1890ff;cursor: pointer;">${
                  keyTitle[keyList.indexOf(i)]
                }</span>`;
              }
            });
            item.experimentKeywords.data = keyTitle.join("+");
          }
        });
        this.total = res.data.data.total;
        this.loading = false;
      });
    },
    onSelectChange(data) {
      this.selectList = data;
    },
    // 点击展开行
    expandChange(data, expandedRows) {
      this.expandeShow = true;
      QueryManageApi.sampleQuerys
        .getNotBankExperimentsById({ id: data.id })
        .then(res => {
          this.expandList = res.data.data;
          this.expandeShow = false;
        });
      var that = this;
      if (expandedRows.length) {
        that.expandId = [];
        if (data) {
          that.expandId.push(data.id); // 每次push进去的是每行的ID
        }
      } else {
        that.expandId = []; // 默认不展开
      }
    },
    // 根据选择市县获取医院
    clickOrgTree(v) {
      this.orgTreeC = [];
      this.orgTreeCs = [];
      this.basicData.model.hospitalId.key = "";
      this.basicData.model.departId.key = "";
      this.orgTree.filter(res => {
        if (res.id == v) {
          this.orgTreeC = res.children;
        }
      });
    },
    // 根据选择市县获取医院
    clickOrgTreeC(v) {
      this.orgTreeCs = [];
      this.basicData.model.departId.key = "";
      this.orgTreeC.filter(res => {
        if (res.id == v) {
          this.orgTreeCs = res.children;
        }
      });
    },
    // 获取基础查询
    initOrgTree() {
      orgApi.allTree({}).then(response => {
        const res = response.data;
        this.orgTree = res.data[0].children;
      });
    },
    // 点击展示与收起
    onMoreStatus() {
      this.morderShow = !this.morderShow;
    },
    //点击全选
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 基础信息按钮点击事件
    onSubmit(type) {
      if (type == "query") {
        switch (this.timeType) {
          // 出生日期"
          case "birthtime":
          case "":
            this.basicData.model.birthTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 采血日期
          case "bloodtime":
            this.basicData.model.bloodTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 登记日期
          case "createtime":
            this.basicData.model.createTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 实验日期
          case "experimenttime":
            this.basicData.model.experimentTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 报告日期
          case "reporttime":
            this.basicData.model.reportTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            break;
        }
        switch (this.codeType) {
          // 条形码号"
          case "barcode":
          case "":
            this.basicData.model.barCode = {
              start: this.codeList.start,
              end: this.codeList.end
            };
            this.basicData.model.bloodNum = {
              start: "",
              end: ""
            };
            this.basicData.model.expNum = {
              start: "",
              end: ""
            };
            this.basicData.model.freeNum = {
              start: "",
              end: ""
            };
            break;
          // 采血编号
          case "bloodnum":
            this.basicData.model.barCode = {
              start: this.codeList.start,
              end: this.codeList.end
            };
            this.basicData.model.bloodNum = {
              start: "",
              end: ""
            };
            this.basicData.model.expNum = {
              start: "",
              end: ""
            };
            this.basicData.model.freeNum = {
              start: "",
              end: ""
            };
            break;
          // 实验编号
          case "expnum":
            this.basicData.model.expNum = {
              start: this.codeList.start,
              end: this.codeList.end
            };
            this.basicData.model.bloodNum = {
              start: "",
              end: ""
            };
            this.basicData.model.barCode = {
              start: "",
              end: ""
            };
            this.basicData.model.freeNum = {
              start: "",
              end: ""
            };
            break;
          // 免费券号
          case "freenum":
            this.basicData.model.freeNum = {
              start: this.codeList.start,
              end: this.codeList.end
            };
            this.basicData.model.bloodNum = {
              start: "",
              end: ""
            };
            this.basicData.model.expNum = {
              start: "",
              end: ""
            };
            this.basicData.model.barCode = {
              start: "",
              end: ""
            };
            break;
        }
        this.getList(this.basicData);
      } else if (type == "reset") {
        this.$refs["basicForm"].resetFields();
        this.timeType = "";
        this.codeType = "";
        this.timeList = [];
        this.codeList = {
          start: "",
          end: ""
        };
      } else if (type == "edit") {
        this.$refs["editForm"].validate(valid => {
          if (valid) {
            QueryManageApi.sampleQuerys
              .updateSample(this.selectItem)
              .then(res => {
                if (res.status == 200) {
                  this.$message({
                    type: "success",
                    message: "修改成功!"
                  });
                  this.editShow = false;
                } else {
                  this.$message.error("修改失败!");
                }
              });
            this.getList(this.basicData);
          } else {
            return;
          }
        });
      } else if (type == "pjEdit") {
        let data = {
          expNumList: this.selectItem.expNum ? [this.selectItem.expNum] : [""],
          experimentProjects: this.selectItem.experimentProject
            ? this.selectItem.experimentProject
            : [""]
        };

        QueryManageApi.sampleQuerys.updateProject(data).then(res => {
          if (res.status == 200) {
            this.getList(this.basicData);
            this.$message({
              type: "success",
              message: "修改成功!"
            });
            this.pjShow = false;
          } else {
            this.$message.error("修改失败!");
          }
        });
        this.getList(this.basicData);
      } else if (type == "jlEdit") {
        QueryManageApi.sampleQuerys
          .updateExperimentResult(this.jlList)
          .then(res => {
            if (res.status == 200) {
              this.getList(this.basicData);
              this.$message({
                type: "success",
                message: "修改成功!"
              });
              this.jlShow = false;
            } else {
              this.$message.error("修改失败!");
            }
          });
      }
    },
    // 点击打印
    clickTruePrint() {
      this.handlePrintPrint();
    },
    // 打印事件
    handlePrintPrint() {
      if (this.upLoading) {
        this.$message({
          message: "数据加载中,请稍后...",
          type: "warning"
        });
      } else {
        this.CreateTablePage("print", "采血卡打印", "sampleManage");
      }
    },
    // 点击分页
    handleSizeChange: function(val) {
      this.basicData.size = val;
      this.getList(this.basicData);
    },
    // 选择页码
    handleCurrentChange: function(currentPage) {
      this.basicData.current = currentPage;
      this.getList(this.basicData);
    }
  },
  watch: {
    "selectItem.birthTime": function(v) {
      this.changeBirthTime(v);
    },
    "selectItem.bloodTime": function(v) {
      this.changeBloodTime(v);
    }
  }
};
</script>

<style lang="less">
.flex {
  display: flex;
  align-items: center;
  justify-content: center;
}
#samplequery {
  .el-form-item__content,
  .el-date-editor,
  .el-select,
  .el-textarea {
    width: 100% !important;
  }
  .pj {
    .el-form-item__label {
      width: 115px !important;
    }
  }
  .mores {
    .flex;
    justify-content: flex-start;
    width: 100%;
    background: #188ff233;
    height: 30px;
    padding: 5px 8px;
    .more-title {
      font-family: SourceHanSansSC;
      font-style: normal;
      letter-spacing: 0px;
      line-height: 20px;
      text-decoration: none;
      margin-right: 1rem;
      font-size: 14px;
      font-weight: 500;
      color: #000;
    }
  }

  #more-row {
    #shiyan {
      .projectIdList {
        width: 100%;
        .el-form-item__content {
          width: 80%;
        }
      }
    }
    .more-col {
      .remark {
        width: 100%;
        .el-form-item__content {
          width: 90%;
        }
      }
    }
    .el-form-item {
      .el-form-item__content {
        width: 400px;
      }
    }
  }
  .buttom {
    width: 100%;
    .flex;
  }
  .el-dialog__header {
    border-bottom: 1px solid #e0e0e0;
  }
  .print-form {
    max-height: 500px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    flex-flow: wrap;
    .print-item {
      width: 50%;
      .flex;
      justify-content: flex-start;
      color: #222222;
      font-size: 15px;
      margin-top: 10px;
      .title {
        font-weight: bold;
        flex: 0.4;
      }
      .value {
        flex: 0.6;
        font-weight: bold;
        overflow-wrap: anywhere;
      }
    }
  }
  .el-dialog__footer {
    .flex;
  }
  .select-input {
    .picker {
      width: 500px;
    }
    .select-i {
      width: 300px;
    }
    @media screen and (max-width: 1600px) {
      .picker {
        width: 400px;
      }
      .select-i {
        width: 150px;
      }
    }
    .flex;
    margin-bottom: 18px;
    .el-select .el-input {
      width: 110px;
    }
    .input-with-select .el-input-group__prepend {
      background-color: #fff;
    }
  }
}
</style>
